﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace MM.Toolkit.Tester
{
    public class CarService
    {
        private static List<Car> cars = null;

        #region -: Delegates :-

        public delegate void GetCarsCompletedEventHandler(object sender, GetCarsCompletedEventArgs e);

        #endregion

        #region -: Events :-

        public event GetCarsCompletedEventHandler GetCarsCompleted;

        #endregion

        #region -: Worker Methods :-

        private void worker_DoWork(object sender, DoWorkEventArgs e)
        {
            String searchtext = e.Argument as String;
            List<Car> result = null;

            result = new List<Car>();

            // You can make your search as complex or basic as you like, this is only an illustration/example
            if (!String.IsNullOrWhiteSpace(searchtext))
            {
                foreach (Car car in cars)
                {
                    if ((car.Model.IndexOf(searchtext, StringComparison.OrdinalIgnoreCase) >= 0) ||
                        (car.Brand.IndexOf(searchtext, StringComparison.OrdinalIgnoreCase) >= 0) ||
                        ((car.Brand + " " + car.Model).IndexOf(searchtext, StringComparison.OrdinalIgnoreCase) >= 0))
                    {
                        result.Add(car);
                    }
                }

                // Adding a delay so the search should take a little time...only for illustration
                System.Threading.Thread.Sleep(1000);
            }

            e.Result = result;
        }

        private void worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (this.GetCarsCompleted != null)
                this.GetCarsCompleted(this, new GetCarsCompletedEventArgs() { Result = e.Result as List<Car> });
        }

        #endregion

        #region -: Public Methods :-

        public void GetCarsAsync(String CarSearchString)
        {
            BackgroundWorker worker = null;

            if (cars == null)
                loadStaticCars();

            try
            {
                worker = new BackgroundWorker();
                worker.DoWork += new DoWorkEventHandler(worker_DoWork);
                worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);
                worker.WorkerReportsProgress = false;
                worker.WorkerSupportsCancellation = false;
                worker.RunWorkerAsync(CarSearchString);
            }
            catch (Exception ex)
            {
                if (this.GetCarsCompleted != null)
                    this.GetCarsCompleted(this, new GetCarsCompletedEventArgs() { Error = ex });
            }
            finally
            {
                worker = null;
            }
        }

        #endregion

        #region -: Private Methods :-

        private void loadStaticCars()
        {
            if (cars == null)
                cars = new List<Car>();

            cars.Clear();
            cars.Add(new Car() { Brand = "Alfa Romeo", Model = "147" });
            cars.Add(new Car() { Brand = "Alfa Romeo", Model = "156" });
            cars.Add(new Car() { Brand = "Alfa Romeo", Model = "159" });
            cars.Add(new Car() { Brand = "Alfa Romeo", Model = "Giulietta" });
            cars.Add(new Car() { Brand = "Alfa Romeo", Model = "Spider" });

            cars.Add(new Car() { Brand = "Aston Martin", Model = "DB9" });
            cars.Add(new Car() { Brand = "Aston Martin", Model = "V8 Vantage" });

            cars.Add(new Car() { Brand = "Audi", Model = "A1" });
            cars.Add(new Car() { Brand = "Audi", Model = "A2" });
            cars.Add(new Car() { Brand = "Audi", Model = "A3" });
            cars.Add(new Car() { Brand = "Audi", Model = "A4" });
            cars.Add(new Car() { Brand = "Audi", Model = "A5" });
            cars.Add(new Car() { Brand = "Audi", Model = "A6" });
            cars.Add(new Car() { Brand = "Audi", Model = "A7" });
            cars.Add(new Car() { Brand = "Audi", Model = "A8" });
            cars.Add(new Car() { Brand = "Audi", Model = "60" });
            cars.Add(new Car() { Brand = "Audi", Model = "80" });
            cars.Add(new Car() { Brand = "Audi", Model = "90" });
            cars.Add(new Car() { Brand = "Audi", Model = "100" });
            cars.Add(new Car() { Brand = "Audi", Model = "200" });
            cars.Add(new Car() { Brand = "Audi", Model = "S6" });
            cars.Add(new Car() { Brand = "Audi", Model = "S8" });
            cars.Add(new Car() { Brand = "Audi", Model = "Q5" });
            cars.Add(new Car() { Brand = "Audi", Model = "Q7" });

            cars.Add(new Car() { Brand = "Austin", Model = "Healey 3000" });

            cars.Add(new Car() { Brand = "Bentley", Model = "Continental" });

            cars.Add(new Car() { Brand = "BMW", Model = "1-series" });
            cars.Add(new Car() { Brand = "BMW", Model = "3-series" });
            cars.Add(new Car() { Brand = "BMW", Model = "5-series" });
            cars.Add(new Car() { Brand = "BMW", Model = "6-series" });
            cars.Add(new Car() { Brand = "BMW", Model = "7-series" });
            cars.Add(new Car() { Brand = "BMW", Model = "8-series" });
            cars.Add(new Car() { Brand = "BMW", Model = "M3" });
            cars.Add(new Car() { Brand = "BMW", Model = "M5" });
            cars.Add(new Car() { Brand = "BMW", Model = "M6" });
            cars.Add(new Car() { Brand = "BMW", Model = "X1" });
            cars.Add(new Car() { Brand = "BMW", Model = "X3" });
            cars.Add(new Car() { Brand = "BMW", Model = "X5" });
            cars.Add(new Car() { Brand = "BMW", Model = "X6" });
            cars.Add(new Car() { Brand = "BMW", Model = "Z3" });
            cars.Add(new Car() { Brand = "BMW", Model = "Z4" });

            cars.Add(new Car() { Brand = "Buick", Model = "Centurion" });
            cars.Add(new Car() { Brand = "Buick", Model = "Century" });
            cars.Add(new Car() { Brand = "Buick", Model = "Le Sabre" });
            cars.Add(new Car() { Brand = "Buick", Model = "Park Avenue" });
            cars.Add(new Car() { Brand = "Buick", Model = "Skylark" });

            cars.Add(new Car() { Brand = "Cadillac", Model = "Deville" });
            cars.Add(new Car() { Brand = "Cadillac", Model = "Eldorado" });
            cars.Add(new Car() { Brand = "Cadillac", Model = "Escalade" });
            cars.Add(new Car() { Brand = "Cadillac", Model = "Seville" });

            cars.Add(new Car() { Brand = "Chevrolet", Model = "Tahoe" });
            cars.Add(new Car() { Brand = "Chevrolet", Model = "Silverado" });
            cars.Add(new Car() { Brand = "Chevrolet", Model = "Impala" });
            cars.Add(new Car() { Brand = "Chevrolet", Model = "Aveo" });
            cars.Add(new Car() { Brand = "Chevrolet", Model = "Chevelle" });
            cars.Add(new Car() { Brand = "Chevrolet", Model = "Captiva" });
            cars.Add(new Car() { Brand = "Chevrolet", Model = "Camaro" });
            cars.Add(new Car() { Brand = "Chevrolet", Model = "Blazer" });
            cars.Add(new Car() { Brand = "Chevrolet", Model = "El Camino" });
            cars.Add(new Car() { Brand = "Chevrolet", Model = "Epica" });

            cars.Add(new Car() { Brand = "Chrysler", Model = "Grand Voyager" });
            cars.Add(new Car() { Brand = "Chrysler", Model = "Stratus" });
            cars.Add(new Car() { Brand = "Chrysler", Model = "Voyager" });
            cars.Add(new Car() { Brand = "Chrysler", Model = "PT Cruiser" });
            cars.Add(new Car() { Brand = "Chrysler", Model = "300C" });

            cars.Add(new Car() { Brand = "Citroen", Model = "C1" });
            cars.Add(new Car() { Brand = "Citroen", Model = "C2" });
            cars.Add(new Car() { Brand = "Citroen", Model = "C3" });
            cars.Add(new Car() { Brand = "Citroen", Model = "C4" });
            cars.Add(new Car() { Brand = "Citroen", Model = "C5" });
            cars.Add(new Car() { Brand = "Citroen", Model = "C8" });
            cars.Add(new Car() { Brand = "Citroen", Model = "Xsara" });
            cars.Add(new Car() { Brand = "Citroen", Model = "DS3" });
            cars.Add(new Car() { Brand = "Citroen", Model = "Berlingo" });
            cars.Add(new Car() { Brand = "Citroen", Model = "Jumpy" });
            cars.Add(new Car() { Brand = "Citroen", Model = "Xantia" });

            cars.Add(new Car() { Brand = "Daewoo", Model = "Espero" });
            cars.Add(new Car() { Brand = "Daewoo", Model = "Kalos" });
            cars.Add(new Car() { Brand = "Daewoo", Model = "Leganza" });
            cars.Add(new Car() { Brand = "Daewoo", Model = "Musso" });
            cars.Add(new Car() { Brand = "Daewoo", Model = "Nubira" });

            cars.Add(new Car() { Brand = "Daihatsu", Model = "Terios" });
            cars.Add(new Car() { Brand = "Daihatsu", Model = "Sirion" });
            cars.Add(new Car() { Brand = "Daihatsu", Model = "YRV" });
            cars.Add(new Car() { Brand = "Daihatsu", Model = "Charade" });
            cars.Add(new Car() { Brand = "Daihatsu", Model = "Gran Move" });

            cars.Add(new Car() { Brand = "Dodge", Model = "RAM" });
            cars.Add(new Car() { Brand = "Dodge", Model = "Viper" });
            cars.Add(new Car() { Brand = "Dodge", Model = "Journey" });
            cars.Add(new Car() { Brand = "Dodge", Model = "Durango" });
            cars.Add(new Car() { Brand = "Dodge", Model = "Caliber" });

            cars.Add(new Car() { Brand = "Ferrari", Model = "360" });
            cars.Add(new Car() { Brand = "Ferrari", Model = "430" });
            cars.Add(new Car() { Brand = "Ferrari", Model = "456" });
            cars.Add(new Car() { Brand = "Ferrari", Model = "California" });
            cars.Add(new Car() { Brand = "Ferrari", Model = "Testarossa" });

            cars.Add(new Car() { Brand = "Fiat", Model = "Punto" });
            cars.Add(new Car() { Brand = "Fiat", Model = "Scudo" });
            cars.Add(new Car() { Brand = "Fiat", Model = "Strada" });
            cars.Add(new Car() { Brand = "Fiat", Model = "500" });
            cars.Add(new Car() { Brand = "Fiat", Model = "Bravo" });

            cars.Add(new Car() { Brand = "Ford", Model = "Escort" });
            cars.Add(new Car() { Brand = "Ford", Model = "Fiesta" });
            cars.Add(new Car() { Brand = "Ford", Model = "Galaxy" });
            cars.Add(new Car() { Brand = "Ford", Model = "Granada" });
            cars.Add(new Car() { Brand = "Ford", Model = "Mustang" });
            cars.Add(new Car() { Brand = "Ford", Model = "Scorpio" });
            cars.Add(new Car() { Brand = "Ford", Model = "Thunderbird" });
            cars.Add(new Car() { Brand = "Ford", Model = "Taurus" });
            cars.Add(new Car() { Brand = "Ford", Model = "C-Max" });
            cars.Add(new Car() { Brand = "Ford", Model = "Connect" });

            cars.Add(new Car() { Brand = "Honda", Model = "Accord" });
            cars.Add(new Car() { Brand = "Honda", Model = "Prelude" });
            cars.Add(new Car() { Brand = "Honda", Model = "Civic" });
            cars.Add(new Car() { Brand = "Honda", Model = "CR-V" });
            cars.Add(new Car() { Brand = "Honda", Model = "CR-Z" });

            cars.Add(new Car() { Brand = "Hummer", Model = "H1" });
            cars.Add(new Car() { Brand = "Hummer", Model = "H2" });
            cars.Add(new Car() { Brand = "Hummer", Model = "H3" });

            cars.Add(new Car() { Brand = "Hyundai", Model = "i10" });
            cars.Add(new Car() { Brand = "Hyundai", Model = "i20" });
            cars.Add(new Car() { Brand = "Hyundai", Model = "i30" });
            cars.Add(new Car() { Brand = "Hyundai", Model = "i40" });
            cars.Add(new Car() { Brand = "Hyundai", Model = "Santa Fe" });
            cars.Add(new Car() { Brand = "Hyundai", Model = "Terracan" });
            cars.Add(new Car() { Brand = "Hyundai", Model = "Tucson" });
            cars.Add(new Car() { Brand = "Hyundai", Model = "Elantra" });
            cars.Add(new Car() { Brand = "Hyundai", Model = "Accent" });
            cars.Add(new Car() { Brand = "Hyundai", Model = "Elantra" });

            cars.Add(new Car() { Brand = "Isuzu", Model = "D-max" });
            cars.Add(new Car() { Brand = "Isuzu", Model = "Trooper" });

            cars.Add(new Car() { Brand = "Jaguar", Model = "E-type" });
            cars.Add(new Car() { Brand = "Jaguar", Model = "S-type" });
            cars.Add(new Car() { Brand = "Jaguar", Model = "X-type" });
            cars.Add(new Car() { Brand = "Jaguar", Model = "JX" });
            cars.Add(new Car() { Brand = "Jaguar", Model = "XF" });

            cars.Add(new Car() { Brand = "Jeep", Model = "Wrangler" });
            cars.Add(new Car() { Brand = "Jeep", Model = "Compass" });
            cars.Add(new Car() { Brand = "Jeep", Model = "Cherokee" });
            cars.Add(new Car() { Brand = "Jeep", Model = "Commander" });
            cars.Add(new Car() { Brand = "Jeep", Model = "Patriot" });

            cars.Add(new Car() { Brand = "Kia", Model = "Cee'd" });
            cars.Add(new Car() { Brand = "Kia", Model = "Sportage" });
            cars.Add(new Car() { Brand = "Kia", Model = "Rio" });

            cars.Add(new Car() { Brand = "Koenigsegg", Model = "CRR" });

            cars.Add(new Car() { Brand = "Lada", Model = "1500" });
            cars.Add(new Car() { Brand = "Lada", Model = "Niva" });

            cars.Add(new Car() { Brand = "Lamborghini", Model = "Aventador" });
            cars.Add(new Car() { Brand = "Lamborghini", Model = "Countach" });
            cars.Add(new Car() { Brand = "Lamborghini", Model = "Diablo" });
            cars.Add(new Car() { Brand = "Lamborghini", Model = "Gallardo" });

            cars.Add(new Car() { Brand = "Lancia", Model = "Delta" });
            cars.Add(new Car() { Brand = "Lancia", Model = "Kappa" });
            cars.Add(new Car() { Brand = "Lancia", Model = "Lybra" });
            cars.Add(new Car() { Brand = "Lancia", Model = "Thema" });
            cars.Add(new Car() { Brand = "Lancia", Model = "Thesis" });

            cars.Add(new Car() { Brand = "Land Rover", Model = "Defender" });
            cars.Add(new Car() { Brand = "Land Rover", Model = "Discovery" });
            cars.Add(new Car() { Brand = "Land Rover", Model = "Freelander" });
            cars.Add(new Car() { Brand = "Land Rover", Model = "Range Rover" });

            cars.Add(new Car() { Brand = "Lexus", Model = "CT200h" });
            cars.Add(new Car() { Brand = "Lexus", Model = "GS" });
            cars.Add(new Car() { Brand = "Lexus", Model = "IS" });
            cars.Add(new Car() { Brand = "Lexus", Model = "LS" });
            cars.Add(new Car() { Brand = "Lexus", Model = "RX300" });
            cars.Add(new Car() { Brand = "Lexus", Model = "RX400h" });
            cars.Add(new Car() { Brand = "Lexus", Model = "RX450h" });

            cars.Add(new Car() { Brand = "Lincoln", Model = "Town Car" });

            cars.Add(new Car() { Brand = "Lotus", Model = "Elise" });
            cars.Add(new Car() { Brand = "Lotus", Model = "Evora" });
            cars.Add(new Car() { Brand = "Lotus", Model = "Exige" });
            cars.Add(new Car() { Brand = "Lotus", Model = "Seven" });
            cars.Add(new Car() { Brand = "Lotus", Model = "Esprit" });

            cars.Add(new Car() { Brand = "Maserati", Model = "Coupe" });
            cars.Add(new Car() { Brand = "Maserati", Model = "Mistral" });
            cars.Add(new Car() { Brand = "Maserati", Model = "Quattroporte" });

            cars.Add(new Car() { Brand = "Mazda", Model = "2" });
            cars.Add(new Car() { Brand = "Mazda", Model = "3" });
            cars.Add(new Car() { Brand = "Mazda", Model = "5" });
            cars.Add(new Car() { Brand = "Mazda", Model = "6" });
            cars.Add(new Car() { Brand = "Mazda", Model = "Premacy" });
            cars.Add(new Car() { Brand = "Mazda", Model = "RX-7" });
            cars.Add(new Car() { Brand = "Mazda", Model = "RX-8" });
            cars.Add(new Car() { Brand = "Mazda", Model = "MX-3" });
            cars.Add(new Car() { Brand = "Mazda", Model = "MX-5" });
            cars.Add(new Car() { Brand = "Mazda", Model = "626" });

            cars.Add(new Car() { Brand = "Mercedes-Benz", Model = "A Class" });
            cars.Add(new Car() { Brand = "Mercedes-Benz", Model = "B Class" });
            cars.Add(new Car() { Brand = "Mercedes-Benz", Model = "C Class" });
            cars.Add(new Car() { Brand = "Mercedes-Benz", Model = "E Class" });
            cars.Add(new Car() { Brand = "Mercedes-Benz", Model = "M Class" });
            cars.Add(new Car() { Brand = "Mercedes-Benz", Model = "R Class" });
            cars.Add(new Car() { Brand = "Mercedes-Benz", Model = "S Class" });
            cars.Add(new Car() { Brand = "Mercedes-Benz", Model = "E Class" });
            cars.Add(new Car() { Brand = "Mercedes-Benz", Model = "Vito" });
            cars.Add(new Car() { Brand = "Mercedes-Benz", Model = "Sprinter" });
            cars.Add(new Car() { Brand = "Mercedes-Benz", Model = "Geländewagen" });

            cars.Add(new Car() { Brand = "MINI", Model = "Clubman" });
            cars.Add(new Car() { Brand = "MINI", Model = "Cooper S" });
            cars.Add(new Car() { Brand = "MINI", Model = "Cooper" });
            cars.Add(new Car() { Brand = "MINI", Model = "Countryman" });
            cars.Add(new Car() { Brand = "MINI", Model = "One" });

            cars.Add(new Car() { Brand = "Mitsubishi", Model = "Outlander" });
            cars.Add(new Car() { Brand = "Mitsubishi", Model = "Space Wagon" });
            cars.Add(new Car() { Brand = "Mitsubishi", Model = "Grandis" });
            cars.Add(new Car() { Brand = "Mitsubishi", Model = "Carisma" });
            cars.Add(new Car() { Brand = "Mitsubishi", Model = "Pajero" });

            cars.Add(new Car() { Brand = "Morgan", Model = "4/4" });
            cars.Add(new Car() { Brand = "Morgan", Model = "Aero 8" });
            cars.Add(new Car() { Brand = "Morgan", Model = "Plus 4" });

            cars.Add(new Car() { Brand = "Morris", Model = "Mini" });

            cars.Add(new Car() { Brand = "Nissan", Model = "Primera" });
            cars.Add(new Car() { Brand = "Nissan", Model = "Qashqai" });
            cars.Add(new Car() { Brand = "Nissan", Model = "Micra" });
            cars.Add(new Car() { Brand = "Nissan", Model = "Navara" });
            cars.Add(new Car() { Brand = "Nissan", Model = "Almera" });

            cars.Add(new Car() { Brand = "Oldsmobile", Model = "Custom" });
            cars.Add(new Car() { Brand = "Oldsmobile", Model = "Cutlass" });
            cars.Add(new Car() { Brand = "Oldsmobile", Model = "Delta" });

            cars.Add(new Car() { Brand = "Opel", Model = "Zafira" });
            cars.Add(new Car() { Brand = "Opel", Model = "Vectra" });
            cars.Add(new Car() { Brand = "Opel", Model = "Omega" });
            cars.Add(new Car() { Brand = "Opel", Model = "Kadett" });
            cars.Add(new Car() { Brand = "Opel", Model = "Astra" });

            cars.Add(new Car() { Brand = "Peugeot", Model = "306" });
            cars.Add(new Car() { Brand = "Peugeot", Model = "406" });
            cars.Add(new Car() { Brand = "Peugeot", Model = "Expert" });

            cars.Add(new Car() { Brand = "Pontiac", Model = "Firebird" });
            cars.Add(new Car() { Brand = "Pontiac", Model = "Trans Am" });
            cars.Add(new Car() { Brand = "Pontiac", Model = "Trans Sport" });

            cars.Add(new Car() { Brand = "Porsche", Model = "911" });
            cars.Add(new Car() { Brand = "Porsche", Model = "928" });
            cars.Add(new Car() { Brand = "Porsche", Model = "Cayenne" });
            cars.Add(new Car() { Brand = "Porsche", Model = "Cayman" });
            cars.Add(new Car() { Brand = "Porsche", Model = "Panamera" });

            cars.Add(new Car() { Brand = "Renault", Model = "Clio" });
            cars.Add(new Car() { Brand = "Renault", Model = "Megane" });
            cars.Add(new Car() { Brand = "Renault", Model = "Kangoo" });
            cars.Add(new Car() { Brand = "Renault", Model = "Laguna" });
            cars.Add(new Car() { Brand = "Renault", Model = "Scenic" });
            cars.Add(new Car() { Brand = "Renault", Model = "16" });
            cars.Add(new Car() { Brand = "Renault", Model = "19" });

            cars.Add(new Car() { Brand = "Rolls Royce", Model = "Silver Shadow" });

            cars.Add(new Car() { Brand = "Rover", Model = "200 series" });
            cars.Add(new Car() { Brand = "Rover", Model = "400 series" });
            cars.Add(new Car() { Brand = "Rover", Model = "600 series" });
            cars.Add(new Car() { Brand = "Rover", Model = "25" });
            cars.Add(new Car() { Brand = "Rover", Model = "45" });
            cars.Add(new Car() { Brand = "Rover", Model = "75" });

            cars.Add(new Car() { Brand = "Saab", Model = "9-3" });
            cars.Add(new Car() { Brand = "Saab", Model = "9-5" });
            cars.Add(new Car() { Brand = "Saab", Model = "900" });
            cars.Add(new Car() { Brand = "Saab", Model = "9000" });
            cars.Add(new Car() { Brand = "Saab", Model = "99" });

            cars.Add(new Car() { Brand = "Seat", Model = "Leon" });
            cars.Add(new Car() { Brand = "Seat", Model = "Ibiza" });
            cars.Add(new Car() { Brand = "Seat", Model = "Toledo" });

            cars.Add(new Car() { Brand = "Skoda", Model = "Octavia" });
            cars.Add(new Car() { Brand = "Skoda", Model = "Superb" });
            cars.Add(new Car() { Brand = "Skoda", Model = "Fabia " });
            cars.Add(new Car() { Brand = "Skoda", Model = "Yeti" });
            cars.Add(new Car() { Brand = "Skoda", Model = "Felicia" });

            cars.Add(new Car() { Brand = "Smart", Model = "Crossblade" });
            cars.Add(new Car() { Brand = "Smart", Model = "Roadster" });
            cars.Add(new Car() { Brand = "Smart", Model = "Forfour" });

            cars.Add(new Car() { Brand = "Subaru", Model = "Forester" });
            cars.Add(new Car() { Brand = "Subaru", Model = "Impreza" });
            cars.Add(new Car() { Brand = "Subaru", Model = "Justy" });
            cars.Add(new Car() { Brand = "Subaru", Model = "Legacy" });
            cars.Add(new Car() { Brand = "Subaru", Model = "Outback" });

            cars.Add(new Car() { Brand = "Suzuki", Model = "Grand Vitara" });
            cars.Add(new Car() { Brand = "Suzuki", Model = "Liana" });
            cars.Add(new Car() { Brand = "Suzuki", Model = "Swift" });

            cars.Add(new Car() { Brand = "Think", Model = "City" });

            cars.Add(new Car() { Brand = "Toyota", Model = "Avensis" });
            cars.Add(new Car() { Brand = "Toyota", Model = "Carina" });
            cars.Add(new Car() { Brand = "Toyota", Model = "HiAce" });
            cars.Add(new Car() { Brand = "Toyota", Model = "HiClass" });
            cars.Add(new Car() { Brand = "Toyota", Model = "HiLux" });
            cars.Add(new Car() { Brand = "Toyota", Model = "Land Cruiser" });
            cars.Add(new Car() { Brand = "Toyota", Model = "Prius" });
            cars.Add(new Car() { Brand = "Toyota", Model = "Supra" });
            cars.Add(new Car() { Brand = "Toyota", Model = "Verso" });
            cars.Add(new Car() { Brand = "Toyota", Model = "Yaris" });

            cars.Add(new Car() { Brand = "Volkswagen", Model = "Passat" });
            cars.Add(new Car() { Brand = "Volkswagen", Model = "Polo" });
            cars.Add(new Car() { Brand = "Volkswagen", Model = "Touran" });
            cars.Add(new Car() { Brand = "Volkswagen", Model = "Transporter" });
            cars.Add(new Car() { Brand = "Volkswagen", Model = "Golf" });
            cars.Add(new Car() { Brand = "Volkswagen", Model = "Crafter" });
            cars.Add(new Car() { Brand = "Volkswagen", Model = "Caravelle" });
            cars.Add(new Car() { Brand = "Volkswagen", Model = "Caddy" });
            cars.Add(new Car() { Brand = "Volkswagen", Model = "Caddy Maxi" });
            cars.Add(new Car() { Brand = "Volkswagen", Model = "Beetle" });

            cars.Add(new Car() { Brand = "Volvo", Model = "240" });
            cars.Add(new Car() { Brand = "Volvo", Model = "740" });
            cars.Add(new Car() { Brand = "Volvo", Model = "850" });
            cars.Add(new Car() { Brand = "Volvo", Model = "940" });
            cars.Add(new Car() { Brand = "Volvo", Model = "S40" });
            cars.Add(new Car() { Brand = "Volvo", Model = "S60" });
            cars.Add(new Car() { Brand = "Volvo", Model = "S80" });
            cars.Add(new Car() { Brand = "Volvo", Model = "V40" });
            cars.Add(new Car() { Brand = "Volvo", Model = "V50" });
            cars.Add(new Car() { Brand = "Volvo", Model = "V60" });
            cars.Add(new Car() { Brand = "Volvo", Model = "V70" });
            cars.Add(new Car() { Brand = "Volvo", Model = "Amazon" });
        }

        #endregion
    }

    public class GetCarsCompletedEventArgs : EventArgs
    {
        public List<Car> Result { get; set; }
        public Exception Error { get; set; }
    }
}
